% \documentclass[dvipsnames]{ctexart}
\documentclass[dvipsnames]{ctexart}
\usepackage{placeins}
\def\MyPattern#1{My Random Prefix and #1}
\def\MySet#1#2{\expandafter\def%
  \csname\MyPattern{#1}\endcsname%
  {#2}
}
\def\MyGet#1{\csname\MyPattern{#1}\endcsname}

\usepackage{fontspec}

\setmonofont{Cascadia}[
Path=/usr/share/fonts/truetype/Cascadia_Code/,
Scale=0.85,
Extension = .ttf,
UprightFont=*Code,              %find CascadiaCode.ttf
BoldFont=*CodePL,               %find CascadiaCodePL.ttf ...
ItalicFont=*CodeItalic,
BoldItalicFont=*CodePLItalic
]

\usepackage{comment}

\usepackage{cleveref}
\crefname{figure}{图}{图}
% ^^^ plural
\Crefname{figure}{图}{图}
% ^^^^^^ type = counter name

\crefname{table}{表}{表}
\Crefname{table}{表}{表}

% \sectionmark 的重定义需要
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usepackage{tikz}
\usetikzlibrary{shapes} % ellipse node shape
\usetikzlibrary{shapes.multipart} % for line breaks in node text
\usetikzlibrary{arrows.meta}    %-o arrow head
\usetikzlibrary{arrows}
\usetikzlibrary{matrix}
\usetikzlibrary{snakes}

\usepackage{tabularray}
\UseTblrLibrary{booktabs,siunitx}
\DefTblrTemplate{contfoot-text}{default}{（表格在下一页还有）}
\DefTblrTemplate{conthead-text}{default}{(从上一页继续)}
\newcommand{\mycola}{MidnightBlue}
\newcommand{\mycolb}{Mahogany}
\newcommand{\mycolc}{OliveGreen}
\usepackage{emoji}
\newcommand{\mycoli}{\mycolb}
\newcommand{\mycolii}{\mycola!30!\mycolb}
\newcommand{\mycoliii}{\mycola!70!\mycolb}
\newcommand{\mycoliv}{\mycola!90!\mycolb}
\newcommand{\mycolv}{\mycola}

\newcommand{\cola}[1]{\textcolor{\mycola}{#1}}
\newcommand{\colb}[1]{\textcolor{\mycolb}{#1}}
\newcommand{\colc}[1]{\textcolor{\mycolc}{#1}}
\newcommand{\Cola}[1]{\textcolor{\mycola}{\textbf{#1}}}

\newcommand{\colZ}[1]{
  {\color{black}#1}
} %go back
\newcommand{\colz}[1]{
  {\color{gray}#1}
}
\usepackage{authoraftertitle} % the definitions of \author, \title and \date can be accessed using \MyAuthor, \MyTitle and \MyDate;


\usepackage{fancyhdr}
\fancyhf{}                      % clear all header and footer fields
\lhead{\textnormal{\kaishu\rightmark}}
% \rhead{--\ \thepage\ --}
\rfoot{--\ \thepage\ --}
\pagestyle{fancy}

\fancyfoot[C]{
  \begin{tikzpicture}[remember picture, overlay]
    % draw a corner at the top right
    \draw[fill=gray,draw=none,opacity=0.2] (current page.north east) -- +(-2,0) -- +(0,-6) -- cycle;
    \draw[fill=gray,draw=none,opacity=0.7] (current page.north east) -- +(-3,0) -- +(0,-4) -- cycle;
    \draw[fill=\mycola,draw=none,opacity=0.7] (current page.north east) -- +(-7,0) -- +(0,-3) -- cycle;


    % draw at the bottom left
    \draw[fill=gray,draw=none,opacity=0.6] (current page.south west) --
    +(7,0) -- +(0,2) -- cycle;
    \draw[fill=\mycola,draw=none,opacity=0.6] (current page.south west) --
    +(2,0) -- +(0,6) -- cycle;
    \draw[fill=gray,draw=none,opacity=0.3] (current page.south west) --
    +(3,0) -- +(0,4) -- cycle;
    
  \end{tikzpicture}
}
% \pagestyle{fancy}

\title{服务器环境可信性智能检测报告}
% \makeatletter\let\Title\@title\makeatother

\date{\today}
\author{我的电脑}

\usepackage[skip=10pt plus1pt, indent=0pt]{parskip}
\usepackage{geometry}\geometry{
  a4paper,
  total={170mm,257mm},
  left=20mm,
  top=20mm,
}
\usepackage{pgfmath}
% --------------------------------------------------
\begin{document}
% \maketitle

% \input{tex/kv.tex}
\input{.generated-tex/kv.tex}

\begin{titlepage}
  \begin{center}
    \vspace*{2cm}
    
    \Huge
    \textbf{\MyTitle}

    
    \small
    \hfill 由北京数涧信息技术有限公司提供技术支持
    
    \vspace{0.5cm}
    \LARGE
    % Thesis Subtitle
    % \vspace{1.5cm}
    % \textbf{Author Name}
  \end{center}

  \vfill
  
  % A thesis presented for the degree of\\
  % Doctor of Philosophy
  % \vspace{0.8cm}

  \hfill
  \begin{tikzpicture}
    % \draw[style=help lines] (-5cm,5cm) grid +(10cm,-10cm);

    % \draw[fill=gray,draw=none,opacity=0.2] (0,0) circle[radius=2cm];
    \draw[fill=gray,draw=none,opacity=0.2] (0,2) arc (90:-180:2cm) -- (0,0) -- cycle;
    % \draw[fill=white,draw=none] (canvas polar cs:angle=-95,radius=2cm) arc (-95:-115:2cm) -- (0,0) -- cycle;

    % the fat rule
    \newdimen\myX
    \newdimen\myY

    \myX=0.5cm
    \myY=3cm
    \coordinate (A) at (0,0);
    \draw[fill=gray!40,draw=none] ([shift={(-\myY,-\myX)}]A) rectangle ([shift={(\myY,\myX)}]A);

    \myX=1.5cm
    \myY=1cm

    % -2.8, -1.5, -0.2, 1.1, 2.4
    \coordinate (A) at (-2.8,0.8);
    \draw[fill=gray!40,draw=none] (A) rectangle ([shift={(\myY,\myX)}]A);
    \coordinate (A) at (-1.5,0.8);
    \myX=3cm
    \draw[fill=\mycola!40,draw=none] (A) rectangle ([shift={(\myY,\myX)}]A);
    \myX=2cm
    \coordinate (A) at (-0.2,0.8);
    \draw[fill=\mycola!20,draw=none] (A) rectangle ([shift={(\myY,\myX)}]A);

    
    \draw[fill=\mycola!30,draw=none,opacity=0.4] (1.5,-1) circle[radius=1cm];
    \draw[fill=\mycola!30,draw=none,opacity=0.8] (0.5,-2) circle[radius=0.3cm];
    \draw[fill=gray!30,draw=none,opacity=0.8] (1,-2.2) circle[radius=0.1cm];
    \draw[fill=\mycola!70,draw=none,opacity=0.8] (0.8,-2.5) circle[radius=0.1cm];
  \end{tikzpicture}
  \hspace{1cm}
  \vspace{3cm}

  \Large
  % Department Name: \\
  % University Name: \\
  % Country: \\

  \hfill
  \begin{tblr}{
      colspec={lr},
      colsep=1cm
    }
    主机名 \colz{hostname}: &  \texttt{\MyGet{hostname}} \\
    生成时间 \colz{time}: & \MyDate
  \end{tblr}

  % 🦜 : draw the header

  \begin{tikzpicture}[remember picture, overlay]
    % draw a corner at the top right
    \draw[fill=gray,draw=none,opacity=0.2] (current page.north east) -- +(-2,0) -- +(0,-6) -- cycle;
    \draw[fill=gray,draw=none,opacity=0.7] (current page.north east) -- +(-3,0) -- +(0,-4) -- cycle;
    \draw[fill=\mycola,draw=none,opacity=0.7] (current page.north east) -- +(-7,0) -- +(0,-3) -- cycle;

    % draw at the bottom left
    \draw[fill=gray,draw=none,opacity=0.6] (current page.south west) --
    +(7,0) -- +(1,15) -- +(0,15) -- cycle;
    \draw[fill=\mycola,draw=none,opacity=0.6] (current page.south west) --
    +(2,0) -- +(0,6) -- cycle;
    \draw[fill=gray,draw=none,opacity=0.3] (current page.south west) --
    +(3,0) -- +(0,4) -- cycle;
  \end{tikzpicture}
\begin{comment}
\end{comment}
\end{titlepage}

% \thispagestyle{fancy}
\tableofcontents

\pagestyle{fancy}
% \thispagestyle{fancy}
\input{cont}

\end{document}

% Local Variables:
% TeX-engine: luatex
% TeX-command-extra-options: "-shell-escape"
% TeX-master: "report"
% TeX-parse-self: t
% TeX-auto-save: t
% End: